package thread;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread lin = new Thread(){
            public void run(){
                try {
                    System.out.println("林：刚做完美容，睡一会儿吧");
                    Thread.sleep(500000);
                } catch (InterruptedException e) {
                    System.out.println("林：干嘛呢！干嘛呢！");
                }
                System.out.println("林：醒了");
            }
        };
        Thread huang = new Thread(){
            public void run(){
                System.out.println("黄：大锤八十，小锤四十");
                try {
                    for (int i = 0;i<5;i++){

                        Thread.sleep(1000);
                        System.out.println("黄：80！");

                    }
                } catch (InterruptedException e) {
                    System.out.println();
                }
                System.out.println("黄：大哥，搞定");
                lin.interrupt();
            }
        };
        lin.start();
        huang.start();
    }
}
